package com.jobson.model;

// Generated May 1, 2013 12:14:36 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * Bank generated by hbm2java
 */
@Entity
@Table(name = "Bank", catalog = "JobsonTally")
public class Bank implements java.io.Serializable
{

   /**
	 * 
	 */
	private static final long serialVersionUID = 4494123112834349202L;
private Integer id;
   private Address address;
   private User userByModifiedBy;
   private User userByCreatedBy;
   private Customer customer;
   private String name;
   private int accountNumber;
   private String swiftcode;
   private String ifsc;
   private Date createdOn;
   private Integer modifiedOn;
   private boolean isPublic;
   private String branch;
   private String beneficiaryName;
   private boolean isDeleted;
   private int tableId;

   // Flag indicate if update has to be called for Customer Table table 
   private boolean isUpdated = false;
   
   public Bank()
   {
	   this.tableId = 2;
   }

   public Bank(String name, int accountNumber, boolean isPublic, String branch, String beneficiaryName, boolean isDeleted, int tableId)
   {
      this.name = name;
      this.accountNumber = accountNumber;
      this.isPublic = isPublic;
      this.branch = branch;
      this.beneficiaryName = beneficiaryName;
      this.isDeleted = isDeleted;
      this.tableId = tableId;
   }

   public Bank(Address address, User userByModifiedBy, User userByCreatedBy, Customer customer, String name, int accountNumber, String swiftcode, String ifsc, Date createdOn, Integer modifiedOn, boolean isPublic, String branch, String beneficiaryName, boolean isDeleted, int tableId)
   {
      this.address = address;
      this.userByModifiedBy = userByModifiedBy;
      this.userByCreatedBy = userByCreatedBy;
      this.customer = customer;
      this.name = name;
      this.accountNumber = accountNumber;
      this.swiftcode = swiftcode;
      this.ifsc = ifsc;
      this.createdOn = createdOn;
      this.modifiedOn = modifiedOn;
      this.isPublic = isPublic;
      this.branch = branch;
      this.beneficiaryName = beneficiaryName;
      this.isDeleted = isDeleted;
      this.tableId = tableId;
   }
   
   public void setIsUpdated(boolean aValue) {
	   this.isUpdated = aValue;
}
   
   @Transient
   public boolean getIsUpdated(){
	   return isUpdated;
   }

   @Id
   @GeneratedValue(strategy = IDENTITY)
   @Column(name = "ID", unique = true, nullable = false)
   public Integer getId()
   {
      return this.id;
   }

   public void setId(Integer id)
   {
      this.id = id;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "Address")
   public Address getAddress()
   {
      return this.address;
   }

   public void setAddress(Address address)
   {
      this.address = address;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "ModifiedBy")
   public User getUserByModifiedBy()
   {
      return this.userByModifiedBy;
   }

   public void setUserByModifiedBy(User userByModifiedBy)
   {
      this.userByModifiedBy = userByModifiedBy;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "CreatedBy")
   public User getUserByCreatedBy()
   {
      return this.userByCreatedBy;
   }

   public void setUserByCreatedBy(User userByCreatedBy)
   {
      this.userByCreatedBy = userByCreatedBy;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "CustomerID")
   public Customer getCustomer()
   {
      return this.customer;
   }

   public void setCustomer(Customer customer)
   {
      this.customer = customer;
   }

   @Column(name = "Name", nullable = false, length = 65535)
   public String getName()
   {
      return this.name;
   }

   public void setName(String name)
   {
      this.name = name;
   }

   @Column(name = "AccountNumber", nullable = false)
   public int getAccountNumber()
   {
      return this.accountNumber;
   }

   public void setAccountNumber(int accountNumber)
   {
      this.accountNumber = accountNumber;
   }

   @Column(name = "Swiftcode", length = 65535)
   public String getSwiftcode()
   {
      return this.swiftcode;
   }

   public void setSwiftcode(String swiftcode)
   {
      this.swiftcode = swiftcode;
   }

   @Column(name = "IFSC", length = 65535)
   public String getIfsc()
   {
      return this.ifsc;
   }

   public void setIfsc(String ifsc)
   {
      this.ifsc = ifsc;
   }

   @Temporal(TemporalType.DATE)
   @Column(name = "CreatedOn", length = 10)
   public Date getCreatedOn()
   {
      return this.createdOn;
   }

   public void setCreatedOn(Date createdOn)
   {
      this.createdOn = createdOn;
   }

   @Column(name = "ModifiedOn")
   public Integer getModifiedOn()
   {
      return this.modifiedOn;
   }

   public void setModifiedOn(Integer modifiedOn)
   {
      this.modifiedOn = modifiedOn;
   }

   @Column(name = "IsPublic", nullable = false)
   public boolean isIsPublic()
   {
      return this.isPublic;
   }

   public void setIsPublic(boolean isPublic)
   {
      this.isPublic = isPublic;
   }

   @Column(name = "Branch", nullable = false, length = 65535)
   public String getBranch()
   {
      return this.branch;
   }

   public void setBranch(String branch)
   {
      this.branch = branch;
   }

   @Column(name = "BeneficiaryName", nullable = false, length = 65535)
   public String getBeneficiaryName()
   {
      return this.beneficiaryName;
   }

   public void setBeneficiaryName(String beneficiaryName)
   {
      this.beneficiaryName = beneficiaryName;
   }

   @Column(name = "IsDeleted", nullable = false)
   public boolean isIsDeleted()
   {
      return this.isDeleted;
   }

   public void setIsDeleted(boolean isDeleted)
   {
      this.isDeleted = isDeleted;
   }

   @Column(name = "TableID", nullable = false)
   public int getTableId()
   {
      return this.tableId;
   }

   public void setTableId(int tableId)
   {
      this.tableId = tableId;
   }

}
